#!/bin/bash
##检测主机是否连接互联网
network_chek(){
	ping 114.114.114.114 -c 4
	if [ $? == '0' ];then
		echo 'network is cennected'
		dns_chek
	else
		echo 'please chek network connect'
		exit 3
	fi
}
dns_chek(){
	ping mirrors.aliyun.com -c 3
	if [ $? == '0' ];then
		echo 'DNS service is normal'
		echo -e "network_status='yes'" >> THEISPI
		export network_status="yes"
	else
		echo 'DNS service error'
		exit 5
	fi
}
network_chek
